<template>
  <div class="container">
    <el-button @click="testToast(1)">打开Toast</el-button>
    <el-button @click="testToast(2)">关闭Toast</el-button>
    <div>
      <SvgIcon name="test" class="test"></SvgIcon>
    </div>
  </div>
</template>

<script setup>
import { configInfo } from '@/api'
import {getCurrentInstance, onMounted} from 'vue'
onMounted(async () => {
  console.log(import.meta.env.VITE_HTTP_URL)
  const res = await configInfo()
  console.log(res, 'res')
})
const currentInstance = getCurrentInstance()
function testToast(type) {
  if(type===1){
    currentInstance.appContext.config.globalProperties.$showToast('显示')
  }else {
    currentInstance.appContext.config.globalProperties.$hideToast()
  }
}
</script>


<style lang="scss" scoped>
.container{
  display: flex;
  flex-direction: column;
  .test {
    font-size: 50px;
    color: green;
  }
}

</style>
